import java.util.Arrays;

class Student implements Comparable<Student>{
    private String name;
    private int score;
    public Student(String name,int score){
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }


    @Override
    public int compareTo(Student o) {
        return this.score - o.score;
    }
}
public class Test {
    public static void main(String[] args) {
//     Student s1 = new Student("大飞",4);
//     Student s2 = new Student("白糖",3);
        Student[] students = new Student[3];
        students[0] = new Student("大飞",4);
        students[1] = new Student("白糖",3);
        students[2] = new Student("武松",5);
        Arrays.sort(students);
        System.out.println(Arrays.toString(students));
    }
}
